<template>
	<view id="queueingCashback">
		<view class="top">
			<view class="left">
				<image :src="user_info.avatar" mode=""></image>
			</view>
			<view class="right" style="color: #323232; font-weight: bold;">
				{{user_info.username}}
			</view>
		</view>
		<view class="center">
			<view>
				<view>{{pai_money}}</view>
				<view>累计奖励</view>
			</view>
			<view>
				<view>{{f_money}}</view>
				<view>已奖励</view>
			</view>
			<view>
				<view>{{pai_money-f_money}}</view>
				<view>待奖励</view>
			</view>
			<!-- <view style=" width: 33%; display: flex; align-items: center; justify-content: flex-end;">
				查看详情
				<u-icon name="arrow-right"></u-icon>
			</view> -->
		</view>
		<view class="bottom">
			<view class="">
				<u-tabs-swiper active-color="#000" :bar-style=action ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false"></u-tabs-swiper>
			</view>
			<!-- <view v-if="current == 0">
				<u-tabs active-color="#000" :bar-style=action :list="list1" :current="current1" @change="change1" :is-scroll="false"></u-tabs>
			</view> -->
			<view v-if="current1 == 0" class="good" v-for="(vv,index) in data">
				<view class="top">
					公排队列:{{vv.gg_id}}
				</view>
				<view class="content">
					<view class="box">
						<view class="top">
							<view class="left">
								<image :src="vv.goods.image" mode=""></image>
								<text class="text">{{vv.goods.goods_name}}</text>
							</view>
							<!-- <view class="right">
								退出排队
							</view> -->
						</view>
						<view class="center">
							<view>
								<view>{{vv.pai_money}}</view>
								<view>累计奖励</view>
							</view>
							<view>
								<view>{{vv.f_money}}</view>
								<view>已奖励</view>
							</view>
							<view>
								<view>{{vv.pai_money-vv.f_money}}</view>
								<view>待奖励</view>
							</view>
						</view>
						<view class="hide" @click="hide = true" v-if="!hide">
							展示完整信息
							<u-icon name="arrow-down-fill"></u-icon>
						</view>
						<view class="info" v-if="hide">
							<view class="">
								<view>订单编号</view>
								<view>{{vv.order_no}}</view>
							</view>
							<view class="">
								<view>实付款</view>
								<view>{{vv.pay_money}}</view>
							</view>
							<view class="">
								<view>购买时间</view>
								<view>{{vv.pay_time}}</view>
							</view>
						</view>
						<!-- <view v-if="hide" style="text-align: center;">进程</view> -->
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				action:{
					backgroundColor:'red',
				},
				hide:false,
				data: [{
					img: "../../static/1.jpg",
					title: "抽灸赚钱",
					time: "2024-01-19 10:54:57",
					money: "5.40",
					state: 0
				}],
				list: [
					{
						name: '奖励队列'
					}, {
						name: '奖励记录'
					}
				],
				list1:[
					{
						name: '商品(1)',
					}, {
						name: '门店(0)'
					}, {
						name: '收银台(0)'
					}					
				],
				current: 0,
				current1: 0,
				user_info:{},
				pai_money:0,
				f_money:0,
				
			}
		},
		onShow(){
			this.$myRequest({
				url: 'api/user/my_pai',
				method:'POST',
			}).then(res=>{
				if(res.data.code==1){
					this.user_info=res.data.data.user
					this.data=res.data.data.list
					this.pai_money=res.data.data.pai_money
					this.f_money=res.data.data.f_money
				}
			})
		},
		methods: {
			change(index) {
				this.current = index;
			},
			change1(index) {
				this.current1 = index;
			},
		}
	}
</script>

<style lang="scss" scoped>
	#queueingCashback {
		min-height: 100vh;
		background-color: #f6f6f6;

		&>view {
			padding: 20rpx;
			box-sizing: border-box;
		}

		.top {
			background-color: #fff;
			display: flex;
			justify-content: start;
			align-items: center;
			
			image {
				width: 140rpx;
				height: 140rpx;
				border-radius: 50%;
				margin-right: 20rpx;
			}

			.right {
				overflow: hidden;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 1;
			}
		}

		.center {
			margin-top: 20rpx;
			background-color: #fff;
			display: flex;
			justify-content: start;
			align-items: center;
			text-align: center;

			&>view {
				width: 32%;

				&>view:nth-of-type(1) {
					font-weight: bold;
					margin-bottom: 10rpx;
				}
			}
		}

		.bottom {
			margin-top: 30rpx;
			background-color: #fff;
			.good{
				padding: 0 20rpx;
				.top{
					font-weight: bold;
					font-size: 32rpx;
					.left{
						display: flex;justify-content: space-between;align-items: center;
					}
					image{
						width:70rpx;
						height: 70rpx;
						border-radius: 50%;
					}
					.right{
						background-color: red;
						color: white;
						font-size: 28rpx;
						font-weight: 400;
					}
				}
				.text{
					width: 400rpx;
					overflow: hidden;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					 -webkit-line-clamp: 1;
					 font-size: 32rpx;
					 font-weight: 400;
				}
				.content{
					.box{
						.top{
							margin: 20rpx 0;
							display: flex;justify-content: space-between;align-items: center;
						}
						.center{
							display: flex;justify-content: space-between;align-items: center;
						}
						.hide{
							text-align: center;
							font-weight: bold;
							margin: 20rpx 0;
						}
						.info{
							margin-top: 30rpx;
							&>view{
								display: flex;
								justify-content: space-between;
								align-items: center;
								flex-wrap: wrap;
								margin: 10rpx 0;
							}
						}
					}
				}
			}
		}
	}
</style>